package 对象之继承.STudent类;

//封装继承多态
//其实方法也是一种封装
public class STudent {
    public static void main(String[] args) {
        STudent s = new STudent();
        s.setName("朱丽伟");
        s.setAge(20);
        System.out.println("大家好我叫：" + s.getName() + "今年" + s.getAge());

        STudent one = new STudent();

        STudent two = new STudent("测试一号", 18);
        System.out.println("大家好，我叫：" + two.getName() + " 今年" + two.getAge());
    }

    private String name;
    private int age;

    public STudent() {
    }

    public STudent(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
